setwd("D:/Rev2Plot/")
rt<-read.table("Observed.dat", header=TRUE)
tmc<-read.table("Observed_TMC.dat", header=TRUE)
cmc<-read.table("Observed_CMC.dat", header=TRUE)
pmc<-read.table("Observed_PMC.dat", header=TRUE)
par(mfcol=c(3,2))
oldpar <- par(mar=c(5,5,1,0.8))
hist(rt$TA12, breaks=c(2,2.5,3,3.5,4,4.5,5,5.5,6)        ,main="ALL",xlab=""                                 ,ylab="N")
hist(tmc$TA12,breaks=c(2,2.5,3,3.5,4,4.5,5,5.5,6)        ,main="TMC",xlab=""                                 ,ylab="N")
hist(cmc$TA12,breaks=c(2,2.5,3,3.5,4,4.5,5,5.5,6)        ,main="CMC",xlab=expression(T[A]~(phantom()^{12}*C*O)/K),ylab="N")
hist(rt$TA13 ,breaks=c(0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5),main="ALL",xlab=""                                 ,ylab="")
hist(tmc$TA13,breaks=c(0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5),main="TMC",xlab=""                                 ,ylab="")
hist(cmc$TA13,breaks=c(0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5),main="CMC",xlab=expression(T[A]~(phantom()^{13}*C*O)/K),ylab="")



setwd("D:/Rev2Plot/")
rt<-read.table("Observed.dat", header=TRUE)
tmc<-read.table("Observed_TMC.dat", header=TRUE)
cmc<-read.table("Observed_CMC.dat", header=TRUE)
pmc<-read.table("Observed_PMC.dat", header=TRUE)
par(mfcol=c(3,2))
oldpar <- par(mar=c(5,5,1,0.8))
hist( rt$FW12,breaks=c(0,0.5,1,1.5,2,2.5,3,3.5,4,4.5),main="ALL",xlab=""                                 ,ylab="N")
hist(tmc$FW12,breaks=c(0,0.5,1,1.5,2,2.5,3,3.5,4,4.5),main="TMC",xlab=""                                 ,ylab="N")
hist(cmc$FW12,breaks=c(0,0.5,1,1.5,2,2.5,3,3.5,4,4.5),main="CMC",xlab=expression(FWHM~(phantom()^{12}*C*O)/km~s^{-1}),ylab="N")
hist( rt$FW13,breaks=seq(0.25,2.25,by=0.25),main="ALL",xlab=""                                 ,ylab="")
hist(tmc$FW13,breaks=seq(0.25,2.25,by=0.25),main="TMC",xlab=""                                 ,ylab="")
hist(cmc$FW13,breaks=seq(0.25,2.25,by=0.25),main="CMC",xlab=expression(FWHM~(phantom()^{13}*C*O)/km~s^{-1}),ylab="")


setwd("D:/Rev2Plot/")
rt<-read.table("Observed.dat", header=TRUE)
tmc<-read.table("Observed_TMC.dat", header=TRUE)
cmc<-read.table("Observed_CMC.dat", header=TRUE)
pmc<-read.table("Observed_PMC.dat", header=TRUE)
par(mfcol=c(3,2))
oldpar <- par(mar=c(5,5,1,0.8))
hist( rt$FW12,breaks=c(0,0.5,1,1.5,2,2.5,3,3.5,4,4.5),main="ALL",xlab=""                                 ,ylab="N")
hist(tmc$FW12,breaks=c(0,0.5,1,1.5,2,2.5,3,3.5,4,4.5),main="TMC",xlab=""                                 ,ylab="N")
hist(cmc$FW12,breaks=c(0,0.5,1,1.5,2,2.5,3,3.5,4,4.5),main="CMC",xlab=expression(FWHM~(phantom()^{12}*C*O)/km~s^{-1}),ylab="N")
hist( rt$FW13,breaks=seq(0.25,2.25,by=0.25),main="ALL",xlab=""                                 ,ylab="")
hist(tmc$FW13,breaks=seq(0.25,2.25,by=0.25),main="TMC",xlab=""                                 ,ylab="")
hist(cmc$FW13,breaks=seq(0.25,2.25,by=0.25),main="CMC",xlab=expression(FWHM~(phantom()^{13}*C*O)/km~s^{-1}),ylab="")
####################################################
####################################################
setwd("D:/Rev2Plot/")                        
rt<-read.table("AllPara_New.dat",header=TRUE)
cmc<-read.table("AllPara_New.dat",header=TRUE)
region="CMC"                                                                            
i=1                                          
while(i<=length(cmc$Name))                    
{	                                           
	j=2                                        
	if(cmc$Region[i]!=region)                   
	{                                          
		while(j<ncol(cmc))                        
		{                                        
			cmc[i,j]<-NA                            
			j<-j+1                                 
		}                                        
	}                                          
	i<-i+1                                     
}        

#replace the unrelated data with NA
tmc<-read.table("AllPara_New.dat",header=TRUE)
region="TMC"                                                                            
i=1                                          
while(i<=length(tmc$Name))                    
{	                                           
	j=2                                        
	if(tmc$Region[i]!=region)                   
	{                                          
		while(j<ncol(tmc))                        
		{                                        
			tmc[i,j]<-NA                            
			j<-j+1                                 
		}                                        
	}                                          
	i<-i+1                                     
}      

par(mfrow=c(3,3))
oldpar <- par(mar=c(5,5,1,0.8))
hist( rt$sTH,breaks=seq(0,0.77,0.1),main="ALL",xlab=expression(sigma[T*H]/k*m~s^{-1}),ylab="N");box()
hist(tmc$sTH,breaks=seq(0,0.77,0.1),main="TMC",xlab=expression(sigma[T*H]/k*m~s^{-1}),ylab="N");box()
hist(cmc$sTH,breaks=seq(0,0.77,0.1),main="CMC",xlab=expression(sigma[T*H]/k*m~s^{-1}),ylab="N");box()    
hist( rt$sNT,breaks=seq(0,0.77,0.1),main="ALL",xlab=expression(sigma[N*T]/k*m~s^{-1}),ylab="N");box()  
hist(tmc$sNT,breaks=seq(0,0.77,0.1),main="TMC",xlab=expression(sigma[N*T]/k*m~s^{-1}),ylab="N");box()  
hist(cmc$sNT,breaks=seq(0,0.77,0.1),main="CMC",xlab=expression(sigma[N*T]/k*m~s^{-1}),ylab="N");box() 
hist( rt$sTH/ rt$sNT,breaks=seq(0,4,0.25),main="ALL",xlab=expression(sigma[T*H]/sigma[N*T]),ylab="N");box()  
hist(tmc$sTH/tmc$sNT,breaks=seq(0,4,0.25),main="TMC",xlab=expression(sigma[T*H]/sigma[N*T]),ylab="N");box()  
hist(cmc$sTH/cmc$sNT,breaks=seq(0,4,0.25),main="CMC",xlab=expression(sigma[T*H]/sigma[N*T]),ylab="N");box()  

####################################################
####################################################



i<-1
tempt<-rt
counter<-1
while(i<=length(rt))
{
	if(rt$sNT[i]>rt$sTH[i])
	{counter<-counter+1}
	i<-i+1
}
   
   
   
hist(rt$X1813, breaks=seq(0,2.25,0.25), xlab=expression(N[H[2]](C^{18}*O)/N[H[2]](phantom()^{13}*C*O)),ylab="N",main="")